<style scoped>

    .layout{
        border: 1px solid #d7dde4;
        background: #f5f7f9;
        position: relative;
        border-radius: 4px;
        overflow: hidden;
    }
    .layout-content{
        min-height: 400px;
        margin: 15px;
        overflow: hidden;
        background: #fff;
        border-radius: 4px;
    }
    .layout-content-main{
        padding: 10px;
    }
    .layout-menu-left{
        background: #464c5b;
    }
    .layout-header{
        height: 50px;
        background: #fff;
        box-shadow: 0 1px 1px rgba(0,0,0,.1);
    }
    .layout-logo-left{
        width: 90%;
        height: 30px;
        background: #5b6270;
        border-radius: 3px;
        margin: 15px auto;
        margin-left: 5px;
    }
    .layout-hide-text .layout-text{
        display: none;
    }
    .ivu-col{
        transition: width .2s ease-in-out;
    }
    .layout-ceiling{
        background: #464c5b;
        padding: 10px 0;
        overflow: hidden;
    }
    .layout-ceiling-main{
        float: right;
        margin-right: 15px;
    }
    .layout-ceiling-main a{
        color: #9ba7b5;
    }
</style>
<template>
    <div class="layout" :class="{'layout-hide-text': spanLeft < 5}">
        <div class="layout-ceiling">
            <div class="layout-ceiling-main">
                <a href="#">注册登录</a> |
                <a href="#">帮助中心</a> |
                <a href="#">安全中心</a> |
                <a href="#">服务大厅</a>
            </div>
        </div>
        <Row type="flex" >
            <i-col :span="spanLeft" class="layout-menu-left">
                <i-menu active-name="1" :theme="menu_theme" width="auto">
                    <!-- <i-input class="layout-logo-left" ></i-input> -->
                    <div class="layout-logo-left">
                        <Radio-group v-model="menu_theme">
                            <Radio label="light"></Radio>
                            <Radio label="dark"></Radio>
                        </Radio-group>
                    </div>

                    <Submenu name="1">
                        <template slot="title">
                            <Icon type="ios-navigate" :size="iconSize"></Icon>
                            <span class="layout-text">导航一</span>
                        </template>
                        <router-link to="center">
                            <Menu-item name="1-1">选项 1</Menu-item>
                        </router-link>
                    </Submenu>
                    <router-link to="Table_test">
                        <Menu-item name="3">
                            <Icon type="ios-analytics" :size="iconSize"></Icon>
                            <span class="layout-text">选项 3</span>
                        </Menu-item>
                    </router-link>
                </i-menu>
                
            </i-col>




            
            <i-col :span="spanRight">

                <div class="layout-header">
                    <i-button type="text" @click="toggleClick">
                        <Icon type="navicon" size="32"></Icon>
                    </i-button>
                    <!--此处留白  -->
                    <span>
                        测试页面
                    </span>
                </div>
                <div class="layout-content">
                    <div class="layout-content-main">
                        <router-view></router-view>
                        内容区域
                    </div>
                </div>
            </i-col>
        </Row>
                
    </div>
</template>
<script>
import top from './commons/Top'
    export default {
        data () {
            return {
                spanLeft: 5,
                spanRight: 19,
                menu_theme:'dark',
            }
        },
        comments : {
            top
        },
        computed: {
            iconSize () {
                return this.spanLeft === 5 ? 14 : 24;
            }
        },
        methods: {
            toggleClick () {
                if (this.spanLeft === 5) {
                    this.spanLeft = 2;
                    this.spanRight = 22;
                } else {
                    this.spanLeft = 5;
                    this.spanRight = 19;
                }
            }
        },
        created : function () {
            
        }
    }
</script>
